package com.yanjiali.controller;

import com.yanjiali.entity.SysUser;
import com.yanjiali.model.R;
import com.yanjiali.service.SysUserService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Package: com.yanjiali.controller
 * @Author: yanjiali
 * @Created: 2025/4/10 22:30
 * 测试接口
 */
@RestController
@Api(tags = "admin-service-test 接口")
public class TestController {

    @Autowired
    private SysUserService sysUserService;

    @GetMapping("/user/info/{id}")
    @ApiOperation(value = "使用用户的 id 查询用户",authorizations =
            {@Authorization("Authorization")})
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "用户的 id 值")
    })
    public R<SysUser> sysUser(@PathVariable("id")Long id){
        SysUser sysUser = sysUserService.getById(id);
        return R.ok(sysUser) ;
    }
}
